# -*- coding:utf-8 -*-
import time
import requests
from bs4 import BeautifulSoup


headers = {
	'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36',
}

start_url = 'https://www.lagou.com/jobs/'

raw_cookies = 'JSESSIONID=ABAAABAAAFCAAEG97E31934235CA46F8B3E784E446CFCD5; user_trace_token=20171206210341-e1f47251-da85-11e7-86e0-525400f775ce; LGUID=20171206210341-e1f47533-da85-11e7-86e0-525400f775ce; X_HTTP_TOKEN=b25ffa7073f2db10391075c49bc6529d; showExpriedIndex=1; showExpriedCompanyHome=1; showExpriedMyPublish=1; hasDeliver=42; _putrc=B814ECB5BAD7CA50; login=true; unick=%E8%92%B2%E7%A5%96%E8%8A%B3; TG-TRACK-CODE=search_code; _gid=GA1.2.818231520.1512565421; Hm_lvt_4233e74dff0ae5bd0a3d81c6ccf756e6=1511956098,1512215277,1512356510,1512565422; Hm_lpvt_4233e74dff0ae5bd0a3d81c6ccf756e6=1512566391; _ga=GA1.2.1763155979.1512565421; LGSID=20171206210341-e1f473aa-da85-11e7-86e0-525400f775ce; LGRID=20171206211951-245005d1-da88-11e7-9c3f-5254005c3644; SEARCH_ID=aefdb5d70d7d4f06ad447098d7ce0a78; index_location_city=%E5%B9%BF%E5%B7%9E'
cookies = {}
for i in raw_cookies.split(';'):
	k, w = i.split('=')
	cookies[k] = w
# print cookies

kd = 'python开发'
params = {
	'first': 'true',
	'pn': 1,
	'kd': kd,
}


def get_page_url():
	res_doc = requests.get(start_url, headers=headers, cookies=cookies, params=params)
	print res_doc.text


if __name__ == '__main__':
	get_page_url()